/* styles.css - 蓝色风格主题 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 40px; /* 为固定的页脚留出空间 */
}

/* 容器样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.nav-bar {
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin-bottom: 15px;
}

h1 {
    font-size: 2.2rem;
    color: #1e3a8a;
    text-align: center;
    margin: 20px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 20px 0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 表单样式 */
form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 20px auto;
}

form label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: bold;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form select,
form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #4b6cb7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(75, 108, 183, 0.2);
}

form input[type="submit"],
.btn {
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

form input[type="submit"]:hover,
.btn:hover {
    background: linear-gradient(to right, #3f5ca7, #0e1a30);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 表格样式 */
table {
    width: 80%;  /* 修改为80%以便居中显示 */
    border-collapse: collapse;
    margin: 20px auto;  /* 修改为auto实现居中 */
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

table th,
table td {
    padding: 12px 15px;
    text-align: center; /* 修改为居中 */
    border-bottom: 1px solid #ddd;
    vertical-align: middle; /* 确保垂直居中 */
}

/* 表格中的操作列居中显示 */
table td.action-cell {
    text-align: center;
}

/* 表格中的操作按钮容器 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

/* 表格容器样式，使表格居中 */
.table-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

/* 表格标题居中 */
.table-title {
    text-align: center;
    margin-bottom: 15px;
}

/* 表格中的操作按钮样式 */
table th {
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    font-weight: bold;
}

table tr:hover {
    background-color: #f1f5fb;
}

table tr:last-child td {
    border-bottom: none;
}

/* 统一的操作按钮样式 */
.action-btn {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    min-width: 80px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border: none;
}

.action-btn.blue {
    background: linear-gradient(to right, #4b6cb7, #182848);
}

.action-btn.blue:hover {
    background: linear-gradient(to right, #3f5ca7, #0e1a30);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.action-btn.red {
    background: linear-gradient(to right, #e74c3c, #c0392b);
}

.action-btn.red:hover {
    background: linear-gradient(to right, #c0392b, #a52a1f);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 链接样式 */
a {
    color: #4b6cb7;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #182848;
    text-decoration: underline;
}

/* 操作链接样式 - 保持原来的大小，适用于消息列表等页面（图2） */
.action-link {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 8px;
    padding: 8px 15px;
    background: #4b6cb7;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.action-link:hover {
    background: linear-gradient(to bottom, #4b6cb7, #182848);
    text-decoration: none;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.action-link.delete {
    background: #e74c3c;
}

.action-link.delete:hover {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
}

/* 用户控制面板中特殊的导航链接样式 */
.nav-links .action-link {
    display: block;  /* 使菜单中的链接占据整行 */
    margin: 10px 0;  /* 增加垂直间距 */
    width: 100%;  /* 占满整个容器宽度 */
    text-align: left;  /* 文字左对齐 */
    padding: 12px 20px;  /* 增加内边距，使按钮更高 */
    font-size: 16px;  /* 更大的字体 */
    position: relative;  /* 为添加箭头图标准备 */
    border-left: 4px solid transparent;  /* 左边框用于悬浮效果 */
}

.nav-links .action-link:hover {
    border-left: 4px solid #fff;  /* 悬浮时左边框变白 */
    padding-left: 25px;  /* 悬浮时文字向右移动 */
}

/* 为图中红框部分专门添加样式（图1-用户控制面板中的按钮） */
#admin-functions .action-link {
    background: linear-gradient(to right, #4568b2, #3a5998);
    margin: 8px 0;
    padding: 8px 12px;  /* 减小内边距 */
    font-size: 14px;    /* 减小字体大小 */
    font-weight: bold;
    border-radius: 6px;
    width: 100%;
    text-align: center;
}

#admin-functions .action-link:hover {
    background: linear-gradient(to right, #3a5998, #1e3c72);
}

/* 提示消息样式 */
.message {
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: bold;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 页脚样式 */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

footer p {
    margin: 0;
}

footer a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s;
}

footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 8px 10px;
    }
}